package com.bestcem.xm.txtanls.controller.param.chart;

import com.bestcem.xm.txtanls.grpc.service.param.chart.BaseChartParam;
import com.bestcem.xm.txtanls.grpc.service.param.chart.ViewpointEvaluateTrendParam;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import java.time.LocalDate;

/**
 * 观点情感分布变化趋势参数
 * @author jy.zhao
 * @version 2.0
 * @date 2021/7/27 18:00
 **/
@Getter
@Setter
public class ViewpointEvaluateTrendQuery extends BaseChartQuery {

    @ApiModelProperty(value = "观点组id")
    @JsonProperty(value = "view_group_id")
    private String viewGid;

    @ApiModelProperty(value = "观点id")
    @JsonProperty(value = "view_id")
    private String viewId;

    public ViewpointEvaluateTrendParam getViewpointEvaluateTrendParam() {
        BaseChartParam baseChartParam = super.getBaseChartParam();
        ViewpointEvaluateTrendParam viewpointEvaluateTrendParam = new ViewpointEvaluateTrendParam();
        BeanUtils.copyProperties(baseChartParam, viewpointEvaluateTrendParam);
        viewpointEvaluateTrendParam.setViewId(viewId);
        viewpointEvaluateTrendParam.setViewGid(viewGid);
        return viewpointEvaluateTrendParam;
    }

    public ViewpointEvaluateTrendQuery(String projectId, String fieldId, String filterType, String current, LocalDate startTime, LocalDate endTime, String viewGid, String viewId) {
        super(projectId, fieldId, filterType, current, startTime, endTime);
        this.viewGid = viewGid;
        this.viewId = viewId;
    }
}